import 'package:get/get.dart';
import 'package:get/get_rx/get_rx.dart';
import 'package:inmotion_pro/pages/models/realtime_item.dart';

enum VehicleRealtimeFormType {
  speed,
  motorTemperature,
  batteryTemperature,
  voltage,
  outputRate,
  iq,
}

class VehicleRealtimeDetailState {
  // 当前速度
  RxDouble currentSpeed = 0.0.obs;

  // 速度单位
  RxString speedUnit = "km/h".obs;

  // 当前输出矢量百分比
  RxDouble currentOutputRate = 0.0.obs;

  // 当前输出矢量百分比最大值，在当前生命周期生效
  RxDouble currentOutputRateMax = 0.0.obs;

  // 电机相电流
  RxDouble currentIq = 0.0.obs;

  // 电机相电流最大值，在当前生命周期生效
  RxDouble currentIqMax = 0.0.obs;

  // 当前电压
  RxDouble currentVoltage = 0.0.obs;

  // 当前电池温度
  RxDouble currentBatteryTemperature = 0.0.obs;

  // 当前电机温度
  RxDouble currentMotorTemperature = 0.0.obs;

  // 实时信息列表
  RxList<RealtimeItemModel> realtimeItems = <RealtimeItemModel>[].obs;

  // 是否编辑状态
  final RxBool isEdit = false.obs;

  // 分页指示器的当前索引
  RxInt currentIndex = 0.obs;

  // 当前表单类型列表
  List<VehicleRealtimeFormType> formTypes = [
    VehicleRealtimeFormType.speed,
    VehicleRealtimeFormType.outputRate,
    VehicleRealtimeFormType.motorTemperature,
    VehicleRealtimeFormType.iq,
    VehicleRealtimeFormType.voltage,
    VehicleRealtimeFormType.batteryTemperature,
  ];
}
